# R script for Kim-Manger: Hubs of Governance
# to load data
# read data
# first the network files
# waves of positive list networks
poslistnet94 <- as.matrix(read.table("poslistSiena1994.dat"))
poslistnet95 <- as.matrix(read.table("poslistSiena1995.dat"))
poslistnet96 <- as.matrix(read.table("poslistSiena1996.dat"))
poslistnet97 <- as.matrix(read.table("poslistSiena1997.dat"))
poslistnet98 <- as.matrix(read.table("poslistSiena1998.dat"))
poslistnet99 <- as.matrix(read.table("poslistSiena1999.dat"))
poslistnet00 <- as.matrix(read.table("poslistSiena2000.dat"))
poslistnet01 <- as.matrix(read.table("poslistSiena2001.dat"))
poslistnet02 <- as.matrix(read.table("poslistSiena2002.dat"))
poslistnet03 <- as.matrix(read.table("poslistSiena2003.dat"))
poslistnet04 <- as.matrix(read.table("poslistSiena2004.dat"))
poslistnet05 <- as.matrix(read.table("poslistSiena2005.dat"))
poslistnet06 <- as.matrix(read.table("poslistSiena2006.dat"))
poslistnet07 <- as.matrix(read.table("poslistSiena2007.dat"))
poslistnet08 <- as.matrix(read.table("poslistSiena2008.dat"))
poslistnet09 <- as.matrix(read.table("poslistSiena2009.dat"))
poslistnet10 <- as.matrix(read.table("poslistSiena2010.dat"))
poslistnet11 <- as.matrix(read.table("poslistSiena2011.dat"))
# # waves of negative list networks
negativelistnet94 <- as.matrix(read.table("neglistSiena1994.dat"))
negativelistnet95 <- as.matrix(read.table("neglistSiena1995.dat"))
negativelistnet96 <- as.matrix(read.table("neglistSiena1996.dat"))
negativelistnet97 <- as.matrix(read.table("neglistSiena1997.dat"))
negativelistnet98 <- as.matrix(read.table("neglistSiena1998.dat"))
negativelistnet99 <- as.matrix(read.table("neglistSiena1999.dat"))
negativelistnet00 <- as.matrix(read.table("neglistSiena2000.dat"))
negativelistnet01 <- as.matrix(read.table("neglistSiena2001.dat"))
negativelistnet02 <- as.matrix(read.table("neglistSiena2002.dat"))
negativelistnet03 <- as.matrix(read.table("neglistSiena2003.dat"))
negativelistnet04 <- as.matrix(read.table("neglistSiena2004.dat"))
negativelistnet05 <- as.matrix(read.table("neglistSiena2005.dat"))
negativelistnet06 <- as.matrix(read.table("neglistSiena2006.dat"))
negativelistnet07 <- as.matrix(read.table("neglistSiena2007.dat"))
negativelistnet08 <- as.matrix(read.table("neglistSiena2008.dat"))
negativelistnet09 <- as.matrix(read.table("neglistSiena2009.dat"))
negativelistnet10 <- as.matrix(read.table("neglistSiena2010.dat"))
negativelistnet11 <- as.matrix(read.table("neglistSiena2011.dat"))
# # # then the individual (monadic) covariates
# # we load all of these into memory now to facilitate changing the specifications later
# # 
gdp  <- as.matrix(read.table("covarlnGdp1.dat"))
gdpCap <- as.matrix(read.table("covarlnGdpCap1.dat"))
democ <- as.matrix(read.table("covarfhScore1.dat"))
dist <- as.matrix(read.table("distanceHubs.dat"))
usTrade <- as.matrix(read.table("usTradeDistanceWeighted.dat"))
chnTrade <- as.matrix(read.table("chnTradeDistanceWeighted.dat"))
usAlly <- as.matrix(read.table("usAlly.dat"))
tradeServicesInGdp <- as.matrix(read.table("TradeinServicesShareGDP.dat"))
valueAddedServicesGdp <- as.matrix(read.table("ServicesValueAddedGDP.dat"))
fdiShare <- as.matrix(read.table("lnFdiStock.dat"))
comLang <- as.matrix(read.table("comLangMatrix.dat"))
comLegOrig <- as.matrix(read.table("comLegOrigMatrix.dat"))
serviLibGats <- read.csv("servLibRoyHubs.dat", header=F)$V1
lnUsFdiServices <- as.matrix(read.table("usFdiServices.dat"))
#
# dyadic changing covariates
Trade94  <- as.matrix(read.table("tradeHubs1994.dat"))
Trade95  <- as.matrix(read.table("tradeHubs1995.dat"))
Trade96  <- as.matrix(read.table("tradeHubs1996.dat"))
Trade97  <- as.matrix(read.table("tradeHubs1997.dat"))
Trade98  <- as.matrix(read.table("tradeHubs1998.dat"))
Trade99  <- as.matrix(read.table("tradeHubs1999.dat"))
Trade00  <- as.matrix(read.table("tradeHubs2000.dat"))
Trade01  <- as.matrix(read.table("tradeHubs2001.dat"))
Trade02  <- as.matrix(read.table("tradeHubs2002.dat"))
Trade03  <- as.matrix(read.table("tradeHubs2003.dat"))
Trade04  <- as.matrix(read.table("tradeHubs2004.dat"))
Trade05  <- as.matrix(read.table("tradeHubs2005.dat"))
Trade06  <- as.matrix(read.table("tradeHubs2006.dat"))
Trade07  <- as.matrix(read.table("tradeHubs2007.dat"))
Trade08  <- as.matrix(read.table("tradeHubs2008.dat"))
Trade09  <- as.matrix(read.table("tradeHubs2009.dat"))
Trade10  <- as.matrix(read.table("tradeHubs2010.dat"))  
Trade11  <- as.matrix(read.table("tradeHubs2011.dat"))
# # 
GoodsPta94  <- as.matrix(read.table("goodsPta1994.dat"))
GoodsPta95  <- as.matrix(read.table("goodsPta1995.dat"))
GoodsPta96  <- as.matrix(read.table("goodsPta1996.dat"))
GoodsPta97  <- as.matrix(read.table("goodsPta1997.dat"))
GoodsPta98  <- as.matrix(read.table("goodsPta1998.dat"))
GoodsPta99  <- as.matrix(read.table("goodsPta1999.dat"))
GoodsPta00  <- as.matrix(read.table("goodsPta2000.dat"))
GoodsPta01  <- as.matrix(read.table("goodsPta2001.dat"))
GoodsPta02  <- as.matrix(read.table("goodsPta2002.dat"))
GoodsPta03  <- as.matrix(read.table("goodsPta2003.dat"))
GoodsPta04  <- as.matrix(read.table("goodsPta2004.dat"))
GoodsPta05  <- as.matrix(read.table("goodsPta2005.dat"))
GoodsPta06  <- as.matrix(read.table("goodsPta2006.dat"))
GoodsPta07  <- as.matrix(read.table("goodsPta2007.dat"))
GoodsPta08  <- as.matrix(read.table("goodsPta2008.dat"))
GoodsPta09  <- as.matrix(read.table("goodsPta2009.dat"))
GoodsPta10  <- as.matrix(read.table("goodsPta2010.dat"))  
GoodsPta11  <- as.matrix(read.table("goodsPta2011.dat"))
#
# BITs in force between countries. Does not include any individual EU member countries.
bit94  <- as.matrix(read.table("hubsBits1994.dat"))
bit95  <- as.matrix(read.table("hubsBits1995.dat"))
bit96  <- as.matrix(read.table("hubsBits1996.dat"))
bit97  <- as.matrix(read.table("hubsBits1997.dat"))
bit98  <- as.matrix(read.table("hubsBits1998.dat"))
bit99  <- as.matrix(read.table("hubsBits1999.dat"))
bit00  <- as.matrix(read.table("hubsBits2000.dat"))
bit01  <- as.matrix(read.table("hubsBits2001.dat"))
bit02  <- as.matrix(read.table("hubsBits2002.dat"))
bit03  <- as.matrix(read.table("hubsBits2003.dat"))
bit04  <- as.matrix(read.table("hubsBits2004.dat"))
bit05  <- as.matrix(read.table("hubsBits2005.dat"))
bit06  <- as.matrix(read.table("hubsBits2006.dat"))
bit07  <- as.matrix(read.table("hubsBits2007.dat"))
bit08  <- as.matrix(read.table("hubsBits2008.dat"))
bit09  <- as.matrix(read.table("hubsBits2009.dat"))
bit10  <- as.matrix(read.table("hubsBits2010.dat"))
bit11  <- as.matrix(read.table("hubsBits2011.dat"))
#
# BITs in force between countries. Treats a BIT as in force with the EU if Britain, France and German
# all have a BIT in force in a given year with the same partner country.
euBit94  <- as.matrix(read.table("eu3BitInForce1994.dat"))
euBit95  <- as.matrix(read.table("eu3BitInForce1995.dat"))
euBit96  <- as.matrix(read.table("eu3BitInForce1996.dat"))
euBit97  <- as.matrix(read.table("eu3BitInForce1997.dat"))
euBit98  <- as.matrix(read.table("eu3BitInForce1998.dat"))
euBit99  <- as.matrix(read.table("eu3BitInForce1999.dat"))
euBit00  <- as.matrix(read.table("eu3BitInForce2000.dat"))
euBit01  <- as.matrix(read.table("eu3BitInForce2001.dat"))
euBit02  <- as.matrix(read.table("eu3BitInForce2002.dat"))
euBit03  <- as.matrix(read.table("eu3BitInForce2003.dat"))
euBit04  <- as.matrix(read.table("eu3BitInForce2004.dat"))
euBit05  <- as.matrix(read.table("eu3BitInForce2005.dat"))
euBit06  <- as.matrix(read.table("eu3BitInForce2006.dat"))
euBit07  <- as.matrix(read.table("eu3BitInForce2007.dat"))
euBit08  <- as.matrix(read.table("eu3BitInForce2008.dat"))
euBit09  <- as.matrix(read.table("eu3BitInForce2009.dat"))
euBit10  <- as.matrix(read.table("eu3BitInForce2010.dat"))
euBit11  <- as.matrix(read.table("eu3BitInForce2011.dat"))
